#{extends 'main.html' /} #{set title:'Home' /}
<div id=main>
	#{if canPublish}
	<form action="@{Topics.createTopic(entityId)}" method="POST">
		<p class="field">
			<label>Title</label><br> <input type="text" name="topic.title"
				value=${draft.subject} required />
		</p>
		<p class="field">
			<label>Description</label><br>
			<textarea rows="20" cols="50" name="topic.body" required>${draft.body}</textarea>
		</p>
		<input type="submit" name="create" value="create" />
	</form>
	#{/if} #{else}
	<p>
		You are not the organizer of this topic <br> <br>
	<p>
	<p>Send topic request to organizer:
	<p>
	<form action="javascript: jQuery.facebox({ajax:'@{Requests.topicRequestSent(entityId)}'});" method="POST">
		<p class="field">
			<label>Title</label><br> <input type="text" name="subject"
				value=${draft.subject} required />
		</p>
		<p class="field">
			<label>Description</label><br>
			<textarea rows="20" cols="50" name="Body" rows="5" cols="25" required>${draft.body}</textarea>
		</p>
		<input type="submit" name="create" value="Send topic request" />
	</form>
	#{/else}
</div>